/*
 * @Author: 陈德基
 * @Date: 2021-11-15 12:33:51
 * @LastEditTime: 2021-11-18 13:41:51
 * @Description: 
 * @FilePath: \copy_gsy_github_app_flutter\lib\app.dart
 * 联系方式：
 * wx: melody_2009
 * qq: 7815171323 
 */
import 'package:copy_gsy_github_app_flutter/routes/app_pages.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

import 'common/localization/localization.dart';
import 'common/style/gsy_style.dart';
import 'routes/app_pages.dart';
import 'utils/logger_util.dart';

class FlutterGetApp extends GetMaterialApp {
  FlutterGetApp({Key? key})
      : super(
            key: key,
            theme: APPTheme.getThemeData(APPColors.primarySwatch),
            logWriterCallback: LoggerUtil.write,
            getPages: AppPages.pages,
            initialRoute: AppRoute.WELCOME,
            locale: Get.deviceLocale,
            translations: APPTranslations(),
            fallbackLocale: Locale('en', 'US'),

            /// 兼容其他三方库使用的翻译代理
            localizationsDelegates: [
              GlobalMaterialLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,

              /// 刷新框架使用的翻译配置
              RefreshLocalizations.delegate,
            ],
            supportedLocales: [
              const Locale('en'),
              const Locale('zh'),
            ]);
}
